package datastructure.deck;


/**
 * User: Lars Christian Ersly
 * Date: 03-06-11
 * Time: 10:26
 */
public class Card {
//    public static enum cardTypes { move1, move2, move3, backup, rotateLeft, rotateRight, uTurn}
    public static enum cardTypes { rotateLeft, rotateRight, uTurn, backup, move1, move2, move3 }

    private int priority;
    private cardTypes cardType;

    /**
     * construct a new card with a type and priority
     * @param cardType the type of card
     * @param priority the priority of the card
     */
    public Card(cardTypes cardType, int priority){
        this.priority = priority;
        this.cardType = cardType;
    }

    /**
     * Constructs a card of a given type, and a priority of 0
     * @param cardType the card type
     */
    public Card(cardTypes cardType){
        this.cardType = cardType;
        this.priority = 0;
    }

    /**
     * Returns the ratio of a given card in a default 84 card datastructure.deck
     */
    public static double getDefRatio(cardTypes cardType){
        switch (cardType) {
            case move1:
                return 18;
            case move2:
                return 12;
            case move3:
                return 6;
            case backup:
                return 6;
            case rotateLeft:
                return 18;
            case rotateRight:
                return 18;
            case uTurn:
                return 6;
            default:
                return 0;
        }
    }

    /**
     * Returns the type of this card
     */
    public cardTypes getCardType() {
        return cardType;
    }

    /**
     * returns the priority of this card
     */
    public int getPriority() {
        return priority;
    }



}
